package com.wxmit.module.system.api;


import com.wxmit.module.system.domain.SysOperateLog;
import com.wxmit.module.system.domain.mapper.OperateLogConvert;
import com.wxmit.module.system.service.ISysOperateLogService;
import com.wxmit.system.api.OperateLogApi;
import com.wxmit.system.domain.SysOperateLogDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @Description OperateLogApi
 * @Author huangxiong
 * @Date 2022/7/12 14:21
 * @Version V1.0
 */
@Service
public class OperateLogApiImpl implements OperateLogApi {

   @Autowired
   ISysOperateLogService operateLogService;

   OperateLogConvert operateLogConvert = OperateLogConvert.INSTANCE;

   @Async
   @Override
   public void saveLog(SysOperateLogDTO sysOperateLogDTO){
      SysOperateLog sysOperateLog = operateLogConvert.DTO2PO(sysOperateLogDTO);
      operateLogService.save(sysOperateLog);
   }
}
